home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 31
/
Aminet 31 (1999)(Schatztruhe)[!][Jun 1999].iso
/
Opus5.5
/
ARexx.lha
/
ARexx
/
ArrangeListers.dopus5
< prev
next >
Wrap
Text File
|
1996-06-05
|
3KB
|
119 lines
/*
$VER: ArrangeListers.dopus5 1.3 (13.5.96)
Written by Edmund Vermeulen (edmundv@grafix.xs4all.nl).
ARexx script for Directory Opus 5.5 to arrange all listers into two neat
rows in an area that is defined by setting all four margins.
This allows you to for example leave visible the drive icons on the left
hand side, or a button bank at the bottom. The source lister is always
placed at the top left while the destination lister is always placed at
the top right.
Function : ARexx DOpus5:ARexx/ArrangeListers.dopus5 {Qp} 110 0 0 0
The four numbers at the end are the left, right, top and bottom margins.
*/
horspace=0 /* horizontal space between listers */
verspace=0 /* vertical space between listers */
ratio=50/50 /* ratio between left and right lister width */
parse arg portname leftmargin rightmargin topmargin bottommargin .
if portname=''|leftmargin=''|rightmargin=''|topmargin=''|bottommargin='' then do
address dopus.1
lf='0a'x
dopus request '"ArrangeListers.dopus5 is not properly installed.'lf||lf||,
'Please read the installation instructions'lf||,
'at the top of the script." Read'
command read 'DOpus5:ARexx/ArrangeListers.dopus5'
exit
end
address value portname
options results
options failat 21
dopus screen
parse var result . width height . barheight .
topmargin=topmargin+barheight+1
lister query all
if rc>0 then
exit
allhandles=result
n=-1
do while allhandles~=''
parse var allhandles thishandle allhandles
lister query thishandle visible
if result then do
n=n+1
handle.n=thishandle
end
end
handle.count=n+1
if handle.count=0 then
exit
half=handle.count%2
lister query source
if rc=0 then do
parse var result srchandle .
do i=0 to handle.count-1
if handle.i=srchandle then do
handle.i=handle.0
handle.0=srchandle
leave
end
end
end
lister query dest
if rc=0 then do
parse var result desthandle .
do i=0 to handle.count-1
if handle.i=desthandle then do
handle.i=handle.half
handle.half=desthandle
leave
end
end
end
rightwidth=(width-rightmargin-leftmargin-horspace)%(ratio+1)
leftwidth=width-rightmargin-leftmargin-horspace-rightwidth
rightpos=leftmargin+leftwidth+horspace
half2=(handle.count+1)%2
listerheight=(height-topmargin-bottommargin-(half2-1)*verspace)%half2
leftover=(height-topmargin-bottommargin-(half2-1)*verspace)//half2
onebigger=handle.count>2&handle.count//2>0
oneleft=handle.count=1&handle.0~=desthandle
y=topmargin
do i=0 to half-1+oneleft
h=listerheight
if i=0 & onebigger then do
h=2*h+verspace
if leftover>0 then
h=h+1
end
if i<leftover-onebigger then
h=h+1
lister set handle.i position leftmargin'/'y'/'leftwidth'/'h
y=y+h+verspace
end
y=topmargin
do i=half+oneleft to handle.count-1
h=listerheight
if i-half<leftover then
h=h+1
lister set handle.i position rightpos'/'y'/'rightwidth'/'h
y=y+h+verspace
end